Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

assertion-error

Package Overview
Dependencies
Maintainers
2
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

assertion-error

Error constructor for test and validation frameworks that implements standardized AssertionError specification.

  • 2.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
15M
increased by4.8%
Maintainers
2
Weekly downloads
 
Created

What is assertion-error?

The assertion-error package is used to create error objects that are specifically meant for testing assertions. It is commonly used in conjunction with assertion libraries to provide a more descriptive error message when an assertion fails. The error object created by assertion-error includes a message and can also include properties that describe the assertion that failed.

What are assertion-error's main functionalities?

Creating an AssertionError instance

This feature allows you to create an instance of an AssertionError with a custom message. This is useful when you want to throw a specific error in your tests when an assertion fails.

{"const AssertionError = require('assertion-error');
const error = new AssertionError('expected value to be true');
throw error;"}

Other packages similar to assertion-error

Keywords

FAQs

Package last updated on 18 Oct 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc